Skip to content

Add Hebrew (he) translation for Local Assist and LLM Enhanced blueprints - #135

Open
yosef-chai wants to merge 1 commit into
music-assistant:mainfrom
yosef-chai:add-hebrew-translation
Open

Add Hebrew (he) translation for Local Assist and LLM Enhanced blueprints#135
yosef-chai wants to merge 1 commit into
music-assistant:mainfrom
yosef-chai:add-hebrew-translation

Conversation

@yosef-chai

@yosef-chai yosef-chai commented May 21, 2026

Copy link
Copy Markdown

Summary

Adds Hebrew (עברית) translations for two blueprints, following the existing per-language convention — one .yaml blueprint per type plus a row in the README import tables:

  • local-assist-blueprint/mass_assist_blueprint_he.yaml
  • llm-enhanced-local-assist-blueprint/mass_llm_enhanced_assist_blueprint_he.yaml
  • README import-table rows for both blueprints (Local Assist + LLM Enhanced)

This is net-new Hebrew media-control voice coverage — there are currently no media_player sentences for Hebrew (he) in home-assistant/intents.

Trigger words

Both blueprints cover idiomatic Hebrew imperative + future-tense verb forms in both masculine and feminine:

  • Play: נגן / נגני / תנגן / תנגני, השמע / השמיעי / תשמיע / תשמיעי
  • Put on (colloquial): שים / שימי / תשים / תשימי
  • Activate: הפעל / הפעילי / תפעיל / תפעילי
  • Listen: האזן / האזיני / תאזין / תאזיני
  • Shuffle: ערבב / ערבבי / תערבב / תערבבי (also detects שאפל, אקראי)

Bracketed suffix matching is used where stems share a root, e.g. נגנ[י] matches both נגן and נגני in a single alternative — following the same convention used in the official Hebrew sentences (home-assistant/intents/sentences/he/_common.yaml).

Definite article and prepositions

The definite article ה and prepositions ב/ל/מ/כ/ש are clitics in Hebrew — attached without a space to the following word. Two approaches are combined for robustness:

  1. Explicit alternatives: every noun alternative lists both the unprefixed and ה-prefixed forms (e.g. אלבום|האלבום|תקליט|התקליט), so the trigger matches regardless of how the STT tokenizes the prefix.
  2. Slot normalization: the area/player slot value is normalized in the action template to strip a leading clitic, so במטבח (one phonetic word) still matches an area named מטבח in Home Assistant.

Vocabulary

Concept Variants accepted
Artist אמן / אמנית / זמר / זמרת / להקה / הרכב
Track שיר / רצועה / הלחן / הסינגל
Album אלבום / תקליט / דיסק / אוסף / EP
Radio תחנת רדיו / רדיו / תחנה / תחנת השידור
Playlist פלייליסט (loanword wins in speech) / רשימת השמעה
Audiobook ספר שמע / ספר מוקלט / אודיובוק / אודיו בוק
"By artist" של (most natural) / מאת

Shuffle detection

The shuffle variable checks for ערבב, תערבב, שאפל, אקראי, or shuffle in trigger.sentence, so all natural Hebrew shuffle phrasings activate shuffle on the target player.

LLM Enhanced specifics

  • Trigger pattern: same verb list as Local Assist + {query}
  • LLM prompt kept in English (best model performance) with added Hebrew hints:
    • media_type mapping table (שירtrack, אלבוםalbum, אמןartist, פלייליסטplaylist, רדיוradio)
    • Israeli artist names in Hebrew (עומר אדם, שלמה ארצי); international artists in English (Pink Floyd, not פינק פלויד); Israeli radio stations in Hebrew (גלגלצ, רשת ב, כאן 88)
  • media_description prompt instructs the LLM to respond in the input language so Hebrew requests get Hebrew spoken-back responses
  • Radio mode options localized: השתמש בהגדרת הנגן / תמיד / אף פעם, with a translation layer that maps them back to the English values the downstream logic expects
  • Combine word: וגם

Examples

תנגן את האמן Pink Floyd במטבח
השמע את האלבום Jagged Little Pill בחדר העבודה
תשמיע את האלבום Greatest Hits של James Taylor במטבח
תנגן את השיר New Years Day בחדר השינה במצב רדיו
שים לי את השיר A Hard Days Night של Billy Joel בחדר השינה
תשמיע את הפלייליסט Classic Rock בחדר העבודה
האזן לתחנת הרדיו גלגלצ במטבח
תנגן את האלבום Classical Nights בסונוס של חדר השינה
ערבב שירים של עומר אדם
תערבב את האלבום Classical Nights על הרמקול של חדר השינה

Validation

  • ✅ YAML parses cleanly (PyYAML, with HA !input tag registered)
  • ✅ All Jinja2 template expressions parse without syntax errors
  • ✅ Hassil syntax confirmed against the official home-assistant/intents/sentences/he/_common.yaml (נגנ[י] char-level matching, [ה]<name> and [ב]<area> prefix patterns are exactly the conventions used there)
  • ✅ All bracket pairs balance in trigger sentences
  • ✅ README diff is purely additive — no existing files modified destructively

Test plan

  • Import the local-assist Hebrew blueprint in Home Assistant and create an automation
  • Issue a Hebrew voice command like תנגן את האלבום Greatest Hits של James Taylor במטבח via Assist and verify the correct album, artist, and area are extracted
  • Verify shuffle detection by issuing ערבב שירים של עומר אדם and confirm the target player has shuffle enabled
  • Verify radio mode by issuing תנגן את השיר X במצב רדיו and confirm radio_mode is set on music_assistant.play_media
  • Import the LLM Enhanced Hebrew blueprint and test against an LLM agent (OpenAI / Gemini) with Hebrew prompts
  • Verify response strings render correctly in Hebrew RTL in the Assist UI

Add:
- Hebrew translation for the Local Assist blueprint
  (local-assist-blueprint/mass_assist_blueprint_he.yaml)
- Hebrew translation for the LLM Enhanced blueprint
  (llm-enhanced-local-assist-blueprint/mass_llm_enhanced_assist_blueprint_he.yaml)
- README import-table rows for both blueprints

Design notes:

Trigger words
Both blueprints cover idiomatic Hebrew imperative + future-tense verb
forms in both masculine and feminine:
- Play: נגן/נגני/תנגן/תנגני, השמע/השמיעי/תשמיע/תשמיעי
- Put on (colloquial): שים/שימי/תשים/תשימי
- Activate: הפעל/הפעילי/תפעיל/תפעילי
- Listen: האזן/האזיני/תאזין/תאזיני
- Shuffle: ערבב/ערבבי/תערבב/תערבבי (also detects שאפל, אקראי)

Bracketed suffix matching is used where stems share a root, e.g. נגנ[י]
matches both נגן and נגני in a single alternative, following the same
convention used by the official Hebrew sentences in
home-assistant/intents (sentences/he/_common.yaml).

Definite article and prepositions
The definite article ה and prepositions ב/ל/מ/כ/ש are clitics attached
without a space to the following word in Hebrew. Two approaches are
combined for robustness:
1. Every noun alternative lists both the unprefixed and ה-prefixed
   forms explicitly (e.g. אלבום|האלבום|תקליט|התקליט), so the trigger
   matches regardless of how the STT tokenizes the prefix.
2. The area/player slot value is normalized in the action template
   with regex_replace to strip leading ב/ל/מ/כ/ש and optional ה, so
   "במטבח" matches an area named "מטבח".

Vocabulary
- Artist: אמן/אמנית/זמר/זמרת/להקה/הרכב (covers both genders + ensembles)
- Track: שיר/רצועה/הלחן/הסינגל
- Album: אלבום/תקליט/דיסק/אוסף/EP
- Radio: תחנת רדיו/רדיו/תחנה/תחנת השידור
- Playlist: פלייליסט/רשימת השמעה (loanword wins in colloquial speech)
- Audiobook: ספר שמע/ספר מוקלט/אודיובוק/אודיו בוק
- "By artist": של (most natural) or מאת

Shuffle detection
The shuffle variable checks for ערבב, תערבב, שאפל, אקראי, or shuffle
in trigger.sentence, so all natural Hebrew shuffle phrasings activate
the shuffle setting on the target player.

LLM Enhanced specifics
- Trigger pattern: same verb list as Local Assist + {query}
- LLM prompt kept in English (best model performance) with added
  Hebrew hints: media_type mapping table (שיר->track, אלבום->album, ...),
  Israeli artist names in Hebrew (עומר אדם, שלמה ארצי), international
  artists in English (Pink Floyd, not פינק פלויד), Israeli radio
  stations in Hebrew (גלגלצ, רשת ב, כאן 88)
- media_description prompt instructs the LLM to respond in the input
  language so Hebrew requests get Hebrew spoken-back responses
- Radio mode options localized with a translation layer that maps back
  to the English values the downstream logic expects
- combine word: וגם (and also)

Tested against
- YAML schema validation (PyYAML + HA !input tag)
- Jinja2 syntax validation of all template expressions
- Hassil syntax conventions (verified against sentences/he/_common.yaml
  in home-assistant/intents)
@yosef-chai
yosef-chai force-pushed the add-hebrew-translation branch from ecb5a66 to 024b160 Compare May 30, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant